package Test.StirngTest;


import com.fasterxml.jackson.databind.ObjectMapper;

import java.util.HashMap;

public class Main2 {
    public static void main(String[] args) throws Exception {
        String jsonString = "{\"complete\":\"prov=上海\tcity=上海市\tdistrict=浦东新区\ttown=洋泾街道\troad=灵山路\troads=灵山路\troadno=958号\thouseno=9号楼\tdetail=road:灵山路, roadno:958号, houseno:9号楼\",\"status\":\"OK\",\"time_used\":{\"rt\":{\"basic_chunking\":0.02497243881225586,\"segment\":0.0005066394805908203,\"address_correct\":0.003228902816772461,\"complete\":0.00018334388732910156,\"address_search\":0.15674138069152832,\"structure\":0.00011444091796875},\"start\":1704182550.386663}}";

        // 替换制表符为转义序列
        String escapedJsonString = jsonString.replace("\t", "\\t");
        System.out.println(escapedJsonString);
        ObjectMapper mapper = new ObjectMapper();
        HashMap addressDTO = mapper.readValue(escapedJsonString, HashMap.class);
        System.out.println(addressDTO);
        Object pro = addressDTO.get("complete");
        System.out.println(pro.toString());

//        System.out.println(addressDTO.getProvince());
//        System.out.println(addressDTO.getCity());
//        System.out.println(addressDTO.getCounty());
//        System.out.println(addressDTO.getTown());
//        System.out.println(addressDTO.getAddress());
//        System.out.println(addressDTO.getContract());
//        System.out.println(addressDTO.getCellphone());
    }
}